<script setup>
import { ref, onBeforeMount } from 'vue';
import emitter from '@/plugins/Bus';
const s = ref();

onBeforeMount(() => {
  emitter.on('on-fn', res => {
    s.value = res
  })
})

</script>

<template>
  <div>
    <h1>这是B组件</h1>
    <div>这是显示内容=======> {{ s }}</div>
  </div>
</template>